package com.ds.dsm.view.config.gallery.nav;


import com.ds.esd.custom.nav.annotation.TabsAnnotation;
import com.ds.esd.custom.tree.annotation.TreeAnnotation;
import com.ds.esd.tool.ui.component.list.TreeListItem;

@TabsAnnotation(singleOpen = true)
@TreeAnnotation(heplBar = true, lazyLoad = true)
public class GalleryNavTree extends TreeListItem {


    public GalleryNavTree(String className, String sourceClassName, String domainId, String viewInstId) {
        this.caption = "画廊配置";
        this.setId("DSMGalleryRoot_" + sourceClassName);
        this.addTagVar("methodName", sourceClassName);
        this.addTagVar("sourceClassName", sourceClassName);
        this.addTagVar("domainId", domainId);
        this.addTagVar("viewInstId", viewInstId);
        this.setIniFold(false);
        GalleryNavItems[] dsmTypes = GalleryNavItems.values();
        for (GalleryNavItems type : dsmTypes) {
            this.addChild(new GalleryNavTree(type, className, sourceClassName, domainId, viewInstId));
        }
    }

    public GalleryNavTree(GalleryNavItems dsmType, String sourceClassName, String methodName, String domainId, String viewInstId) {
        this.caption = dsmType.getName();
        this.imageClass = dsmType.getImageClass();
        this.setEuClassName(dsmType.getClassName());
        this.setId(dsmType.getType() + "_" + sourceClassName + "_" + methodName);
        this.setIniFold(false);
        this.addTagVar("methodName", methodName);
        this.addTagVar("sourceClassName", sourceClassName);
        this.addTagVar("domainId", domainId);
        this.addTagVar("viewInstId", viewInstId);


    }
}
